package com.ruoyi.project.datum.manage.service;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.project.datum.manage.domain.Manage;
import com.ruoyi.project.datum.manage.mapper.ManageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 描述：产品信息 业务处理层
 * 时间：2020/5/19
 * 作者：WangHaiDong
 */
@Service
public class ManageServiceImpl implements IManageService {

    @Autowired
    private ManageMapper manageMapper;

    /**
     * 按条件查询所有的产品信息
     * @param manage
     * @return
     */
    @Override
    public List<Manage> selectAll(Manage manage) {
        return manageMapper.selectAll(manage);
    }

    /**
     * 根据产品型号 批量删除产品信息
     * @param ids
     * @return
     */
    @Override
    public int deleteManageByIds(String ids) {
        Long[] manageIds = Convert.toLongArray(ids);

        return manageMapper.deleteManageByIds(manageIds);
    }

    @Override
    public int updateManage(Manage manage) {
        return manageMapper.updateManage(manage);
    }
}
